This invention relates generally to computer arithmetic. More particularly, this invention relates to a circuit and method for calculating a mathematical function.
One of the primary uses for computers and integrated electronics is to perform large numbers of mathematical operations very quickly. These operations may include mathematical function calculations such as       1    x    ,      1          x        ,
ex, log x, etc. These operations are used in a large number of diverse tasks such as weather forecasting, electronic circuit modeling, beer brewing, and graphics rendering. Unfortunately, the demands being placed on many of these tasks continually pushes the performance of currently available hardware. For example, larger and more complicated weather models lead to weather forecasts that are more accurate. However, if the model doesn""t complete running until after the period it was trying to forecast, the forecast is useless. Accordingly, a smaller, less complicated model is used so that it can complete its forecast in a useful amount of time on the available hardware. Forecasters may want to use the larger more complicated model, but the speed of the hardware prevents the practicality of this. A similar situation exists for many tasks performed by computers and integrated electronics. Therefore, there is a continuing need for faster and better ways to calculate mathematical unctions.
An embodiment of the invention utilizes quadratic interpolation to calculate a mathematical function. In a preferred embodiment, the functions       1    x    ⁢      xe2x80x83    ⁢  and  ⁢      xe2x80x83    ⁢      1          x      
and can be calculated to 24-bit precision from the same hardware. The major components of the hardware to calculate these functions is comprises a look-up table, two Booth-encoded multipliers and a curve-fit function generator. This arrangement allows for fast calculation of the function. This invention is also well adapted to fabrication in monolithic integrated circuits.
Calculating a function according to the present invention includes applying the input number to a look-up table that supplies three coefficients based upon certain bits of the input that define a series of bins. This first coefficient is fed directly to an adder that produces the output. The second coefficient is multiplied by a number corresponding to how far the input is from the edge of a bin. This number is then input to the adder that produces the output. The third coefficient is multiplied by a number that is the result of a curve-fit function input with a number corresponding to how far the input is from the middle of a bin. This result is then input to the adder that produces the output. These three addends are aligned and summed to produce an output that corresponds within a certain precision of a chosen function of the input.
Other aspects and advantages of the present invention will become apparent from the following detailed description, taken in conjunction with the accompanying drawings, illustrating by way of example the principles of the invention.